1. /* slomuldb.cpp by K.Tsuru */
  2. // function ID = 227 DRADIX
  3. /****************************************************************************
  4. SLong class
  5. operator SLong(m)*double(n)
  6. The decimals of n is omitted. It includes the operator with int, long etc.
  7. If only the operator SLong*long is provided a statement
  8. b = a*1.234567890123456789e300;
  9. calls that one.It is necessary to provide the operator SLong*double.
  10. About the other operators SLong*long, SLong*int etc they must have similar process.
  11. Then a faster speed cannot be expected moreover the size of code increases.
  12. To obtain a fast speed it is desirable to use LsMult() or LsDiv() which is
  13. about 25% faster.
  14. ****************************************************************************/
  15. #ifndef SN_H
  16. #include "sn.h"
  17. #endif
  18. SLong operator*(const SLong& m, double n){
  19. if(n == 1.0) return m;
  20. if(n == -1.0) return -m;
  21. if(fabs(n) < 1.0) return SLong(m.Type(), minArraySize);
  22. if(m.Sign(227)==0) return m;
  23. SLong r;
  24. if(fabs(n) <= (double)m.SlOpMaxValue() ){
  25. ulong p = (ulong)fabs(n);
  26. r = LsMult(m, p);
  27. if(n < 0) r.ChangeSign();
  28. } else {
  29. r = n;
  30. r = LLMult(m, r);
  31. }
  32. return r;
  33. }

slomuldb.cpp : last modifiled at 2015/11/27 14:24:35(1,179 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).